package com.yin.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import com.yin.good.entity.GoodInfoDTO;
import com.yin.good.entity.GoodInfoEntity;
import com.yin.good.entity.GoodTypeEntity;

/**
*@author LSY
*Time: 2018年12月28日下午2:12:40
*
*
*/
@Mapper(componentModel = "spring")
public interface GoodInfoMapper {

	@Mappings({
		@Mapping(source = "goodType.name", target = "typeName"),
		@Mapping(source = "goodInfo.id", target = "goodId"),
		@Mapping(source = "goodInfo.title", target = "goodName"),
		@Mapping(source = "goodInfo.price", target = "goodPrice")
	})
	public GoodInfoDTO from(GoodInfoEntity goodInfo, GoodTypeEntity goodType);
}
